file_list_array = Dir.open('google_keywords'){|d|d.grep(/google_keywords.*\.txt/)}
keywords_array=[]

into_onefile = "#{Time.now.strftime('%m%d_%H%M')}all_keywords_into_onefile.txt"
line_array=[]

file_list_array.each do |file|

open('google_keywords\\' + file) { |f|

f.each{|line| 


line_array << line

}}

end

line_array.each do |x|

line_array.delete(x) if Regexp.compile(/\=\=\=\=\=\=\=\= Test Time:.*\=\=\=\=\=\=\=\=\=\=/).match(x.to_s)

#array.delete(x) if x=="======== Test Time: 2008-10-31 12:40:04 ==========\n"

end
line_array.each do |x|
line_array.delete(x) if x =="\n"
line_array.delete(x) if x ==" \n"

end

line_array.each do |x|
x.gsub!("\n","")
x.gsub!("\"","")
x.gsub!("\"","")

end
#puts "---------------------------------------------line_array.inspect-----------------------------------------------------------"

#puts line_array
#puts "---------------------------------------------line_array.each part-----------------------------------------------------------"
line_array.uniq!
line_array.each do |x|
x.gsub!(/.*\|nil/,"%%%")  
end





line_array.each do |x|
 
line_array.delete x if x == "%%%"
end



line_array.each do |x|
 if x == ("%%%" || /.*\|nil/)
puts x 
end
end



#puts line_array

line_array.each do |x|
open(into_onefile, 'a')do |f|
  
 f.puts x
end
end
=begin
=end